﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestProject
{
    class Program
    {
        static void Main(string[] args)
        {
            MyControlLibrary.LocationTypeConverter converter
                = new MyControlLibrary.LocationTypeConverter();

            MyControlLibrary.Location l 
                    = new MyControlLibrary.Location("China", "Beijing");


            object obj = null;
            if( converter.CanConvertTo( typeof(string )))
            {
                
                obj  =  converter.ConvertTo(l,typeof(string));
                Console.WriteLine(obj);
            }

            if ( converter.CanConvertFrom(typeof(string) ))
            {

                object obj2 =
                    converter.ConvertFrom(obj);

                Console.WriteLine(obj2);
            }

            converter.ConvertTo(l, typeof(System.ComponentModel.Design.Serialization.InstanceDescriptor));

        }
    }
}
